﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!-- #include file="inc/conn.inc" -->
<% 
dim manager
flag=session("manager")
%>
<html>
<head>
<title>更改密码</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../images/css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 

a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<SCRIPT language=JavaScript>
<!--
function checkform()
{
 if (document.changepwd.pwd.value=="") {
		alert("请输入原密码！");
		changepwd.pwd.focus();		
		    return (false);
  }
 if (document.changepwd.newpwd.value=="") {
		alert("请输入新密码！");
		changepwd.pwd.focus();		
		    return (false);
  }
  if (document.changepwd.newpwd.value.length<3) {
    alert("密码不能少于三位！");
    return false;   
  }
  if (document.changepwd.newpwd.value != document.changepwd.newpwd2.value) {
    alert("两次密码输入不一致！");
    document.changepwd.newpwd.value="";
    document.changepwd.newpwd2.value="";
	return false;
  }
  return true;
}
//-->
</SCRIPT>
<body bgcolor="#D9E6FF">
<%if session("manager")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登录！');window.location.href='login.asp';</script>"
response.End
end if
%>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td  rowspan="2"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
              <tr> 
                <td class="12v" > 
                  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
                    <tr> 
                      <td> 
                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr> 
                            <td height="22"> 
                              <div align="center"><font color="#000000">管理员密码修改</font></div>
                            </td>
                          </tr>
                          <tr> 
              <td valign="top" width="90%" height="104">
                <form name="changepwd" onSubmit="return checkform();" method="post" action="changepwd.asp" >
                  <table border="0" cellspacing="0" cellpadding="0" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
                        <tr> 
                          <td height="29" bgcolor="#D9E6FF"><br>
                            <table  width="260" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D9E6FF">
                              <tr bgcolor="#FFFFFF"> 
                                <td width="88" bgcolor="#D9E6FF"> 
                                  <div align="left">管理员：</div>
                                </td>
                                <td width="85" bgcolor="#D9E6FF"> 
                                  <div align="left"><%=flag%></div>
                                </td>
                                <td width="77" bgcolor="#D9E6FF"> 
                                  <div align="center">                                  </div>
                                </td>
                              </tr>
                              <tr bgcolor="#FFFFFF">
                                <td bgcolor="#D9E6FF">原密码：</td>
                                <td bgcolor="#D9E6FF"><input name="pwd" type="password" id="admin" size="12"></td>
                                <td bgcolor="#D9E6FF">&nbsp;</td>
                              </tr>
                              <tr bgcolor="#FFFFFF">
                                <td bgcolor="#D9E6FF">新密码：</td>
                                <td bgcolor="#D9E6FF"><input name="newpwd" type="password" id="password" size="12"></td>
                                <td bgcolor="#D9E6FF">&nbsp;</td>
                              </tr>
                              <tr bgcolor="#FFFFFF"> 
                                <td width="88" bgcolor="#D9E6FF"> 
                                  <div align="left">确认新密码：</div>
                                </td>
                                <td width="85" bgcolor="#D9E6FF"> 
                                  <div align="left"> 
                                    <input name="newpwd2" type="password" id="password" size="12">
                                  </div>
                                </td>
                                <td width="77" bgcolor="#D9E6FF"> 
                                  <div align="center"></div>
                                </td>
                              </tr>
                              <tr bgcolor="#FFFFFF"> 
                                    <td colspan="3" height="28" bgcolor="#D9E6FF"><div align="center">
                                      <input  onClick="return check();"  type="image" border="0" name="submit" src="images/xx.gif" width="54" height="18">&nbsp;&nbsp;&nbsp;
                                    <a href="../admin/addm.asp"><img src="images/qc.gif" width="54" height="18" border="0"></a></div></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                </form>
              </td>
            </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td> 
     
    </td>
  </tr>
</table>
<br>
</body>
</html>
<% pwd=Trim(request("pwd"))
if pwd="" then
   response.end
   end if
   newpwd=Trim(request("newpwd"))
   set rs=server.createobject("adodb.recordset")
   sql="select * from manager where mname='"&flag&"' and password='"&pwd&"'"
 
   rs.open sql,dbconnection,3,3
   if rs.bof or rs.eof then
   response.write"<SCRIPT language=JavaScript>alert('原密码错誤，请重新输入！');"
   response.write"javascript:history.go(-1)</SCRIPT>"
   else
   rs("password")=newpwd
   rs.update
   rs.close
   response.write"<SCRIPT language=JavaScript>alert('密码修改成功');"
   response.write"javascript:window.close();</SCRIPT>"
   end if %>
